import request from "@/router/axios.js";

// 获取菜单
export const getMenu = () => request.get("/admin/menu");

// 获取默认项目
export const getProject = () => request.get("/admin/sysDefaultProject");
// 保存默认项目
export const saveProject = obj =>
  request.post("/admin/sysDefaultProject?portalLoading", obj);

// 获取项目树
export const getProjectTree = () =>
  request.get("/admin/sysDefaultProject/getProjectTree");

// 用户默认设置-----------------------------------------------------------------------------------
// 获取
export const gettUserDefaultSet = obj =>
  request.get("/admin/userDefaultSet", { params: obj });
// 添加设置
export const postUserDefaultSet = obj =>
  request.post("/admin/userDefaultSet", obj);
// 根据id修改用户默认设置
export const putUserDefaultSet = obj =>
  request.put("/admin/userDefaultSet", obj);
// 默认_主题设置
export const postDefaultTheme = obj =>
  request.post("/admin/userDefaultSet/saveTheme", obj);
// 默认_系统设置

// eslint-disable-next-line require-jsdoc
export function postDefaultSystem(data, token) {
  return request({
    url: "/admin/userDefaultSet/saveSystem",
    method: "post",
    data,
    headers: {
      Authorization: "Bearer " + token
    }
  });
}

// export const postDefaultSystem = obj =>
//   request.post("/admin/userDefaultSet/saveSystem", obj);
// 获取页面布局
export const getNewsPage = id =>
  request.get("/admin/sysBasePage/getNewsPage", {
    params: {
      system: id
    }
  });
